import { createSSRApp, App as VueApp } from "vue";
import App from "./App.vue";
import { createPinia, Pinia } from "pinia";
import uViewPlus from "uview-plus";
import "uview-plus/index.scss";

interface CreateAppResult {
  app: VueApp<Element>;
  pinia: Pinia;
}

export function createApp(): CreateAppResult {
  const app = createSSRApp(App);
  const pinia = createPinia();

  app.use(uViewPlus);
  app.use(pinia);

  return { app, pinia };
}
